module.exports=(str)=>{
  if (!/%[A-Za-z0-9]{2}/.test(str)) { return str; }
  return Array.from(Buffer.from(str.match(/%[A-Za-z0-9]{2}/g)
      .join("").replace(/%/g, ""), "hex").toString()).
      reduce((par, e) => {
        //e如果是中文需要3对
        if(/[^\x00-\xff]/.test(e)){return par.replace(/(%[A-Za-z0-9]{2}){3}/, e)}
        return par.replace(/%[A-Za-z0-9]{2}/, e);
      }, str);
}